{
  "properties" : { },
  "id" : "44e207c5a7dc404ea0b374b73e9099eb",
  "script" : null,
  "groupId" : "74af8e1135d2474eb9b6b4081e6d5967",
  "name" : "删除拓扑分组",
  "createTime" : 1727071028534,
  "updateTime" : 1726653344253,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "removeGroup",
  "method" : "POST",
  "parameters" : [ {
    "name" : "id",
    "value" : "edfba4ad-0806-4ace-a3d3-cb5ac5b9cb89",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
import org.springblade.core.tool.api.R
import "@/util/getListGroupId" as getListGroupId
import org.springframework.util.CollectionUtils

List res = db.table("ndmp_group_device_relation").where().eq("group_id", id).select()

if (!res.isEmpty()) {
    return R.fail("请先解绑该分组所绑定的设备");
}


List listGroupId = new ArrayList();
getListGroupId(listGroupId, groupId);
listGroupId.add(id);

if (!CollectionUtils.isEmpty(listGroupId)) {

    // 先删除该分组下面的设备，包含子分组
    db.table("ndmp_group_device_relation").where().in("group_id", listGroupId).delete();
    db.table("ndmp_group").where().in("id", listGroupId).delete();

}
db.table("ndmp_topo_msg").where().eq("deptid", groupId).eq("isvalid", "1").delete();